<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../css/Own_Report.css">
    <title>Report</title>
    <script src="../js/jquery-3.4.1.min.js"></script>
</head>
<body>
    <div id="container">
        <div id="content1">
            <div id="content2">
                <p>您将举报的用户ID：</p>
                <p>举报类型：</p>
                <p>您的联系方式：</p>
            </div>
            <div id="content3">
                <input type="text" class="input1" id="who" placeholder="ID" value="">
                <input type="text" class="input1" id="type" placeholder="举报类型" value="">
                <input type="text" class="input1" id="phone" placeholder="联系方式" value="">
            </div>
            <div id="content4">
                <p id="p">举报原因：</p>
                <textarea class="input2" id="why">举报原因</textarea>
                <input type="button" class="input0" onclick="submit1()" value="确定">
            </div>
        </div>
    </div>

    <script type="text/javascript">
        function submit1() {
            var message = JSON.parse(sessionStorage.getItem("head_message"));
            var who = document.getElementById('who').value;
            var type = document.getElementById('type').value;
            var phone = document.getElementById('phone').value;
            var why = document.getElementById('why').value;

            var data= {"Uid":message.Uid, "Who":who, "Type":type, "Phone":phone, "Why":why};
            $.post("/submit1", data, function (result) {
                if (result == true)
                {
                    alert("提交成功");
                    location.reload();
                }else
                {
                    alert("提交失败");
                }
            })
        }
    </script>

</body>
</html>